Go to the source code of this file.
|
| void | QmiService_Initialize (QmiService *pThis, uint8_t serviceType, uint8_t clientId, struct QmuxTransport *pTransport, QMI_INDICATION_CALLBACK pIndicationCallback, void *pIndicationCallbackContext) |
| |
| void | QmiService_ShutDown (QmiService *pThis) |
| |
| uint16_t | QmiService_GetNextTransactionId (QmiService *pThis) |
| |
| int | QmiService_SendRequest (QmiService *pThis, uint16_t transactionId, uint8_t *qmiRequest, uint16_t qmiRequestSize, QMI_RESPONSE_CALLBACK pResponseCallback, void *pResponseCallbackContext) |
| |
| void | QmiService_CancelTransaction (QmiService *pThis, uint16_t transactionId) |
| |
| bool | QmiService_HandleQmiPacket (QmiService *pThis, uint8_t serviceType, uint8_t clientId, uint8_t *qmiPacket, uint16_t qmiPacketSize) |
| |
| #define QMI_TRANSACTION_POOL_SIZE 10 |
Number of concurrent QMI transactions that may be outstanding per QMI service.
| typedef void(* QMI_INDICATION_CALLBACK)(uint8_t *qmiPacket, uint16_t qmiPacketSize, void *pIndicationCallbackContext) |
This funcion prototype represents the callback which is called by the QMI service when a QMI indication is received.
- Parameters
-
| [in] | qmiPacket | indication's QMI packet (note: this does not include QMUX header). |
| [in] | qmiPacketSize | Number of bytes in indication's QMI packet. |
| [in] | pIndicationCallbackContext | User context supplied when QMI service was initialized. |
This structure abstracts a QMI service. It is responsible issuing transaction IDs. It tracks QMI requests and responses using transaction objects from a pool. It invokes a user callback when QMI indications which match its client ID (or a broadcast ID) are received from the transport layer.
- Parameters
-
| pNext |
- A link so we can store this object in a linked list by the transport layer.
|
| serviceType |
- QMI service type, CTL, NAS, etc.
|
| clientId |
|
| pTransport |
- Pointer to underlying QMUX transport object.
|
| transactionId |
- QMI transaction ID. Upper limit 0xffff for regular QMI services, 0xff for CTL service.
|
| transactionIdLock |
- Mutex to make transactionId access thread-safe.
|
| transactionPool |
- Pool of transaction objects which may be assigned to QMI requests made by clients of this service.
|
| transactionPoolLock |
- Mutex to make transactionPool access thread-safe
|
| pIndicationCallback |
- User callback for QMI indications of this service.
|
| pIndicationCallbackContext |
- User context for user callback.
|
| deviceFd |
|
| pQcqmitransport |
- Pointer to QMI service transport object.
|
| void QmiService_CancelTransaction |
( |
QmiService * |
pThis, |
|
|
uint16_t |
transactionId |
|
) |
| |
Cancel an outstanding QMI request.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | transactionId | Transaction ID of outstanding request. |
| uint16_t QmiService_GetNextTransactionId |
( |
QmiService * |
pThis | ) |
|
Returns next transaction ID for a QMI service.
- Parameters
-
| [in] | pThis | The primary object of this call. |
- Returns
- transaction ID
| bool QmiService_HandleQmiPacket |
( |
QmiService * |
pThis, |
|
|
uint8_t |
serviceType, |
|
|
uint8_t |
clientId, |
|
|
uint8_t * |
qmiPacket, |
|
|
uint16_t |
qmiPacketSize |
|
) |
| |
Process a received QMI packet. This function is called by the QMUX transport layer.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | serviceType | QMI service type of received packet. |
| [in] | clientId | QMI Client ID of received packet. |
| [in] | qmiPacket | Pointer to QMI packet. |
| [in] | qmiPacketSize | Pointer to size in bytes of QMI packet. |
- Returns
- true if packet is consumed by function, false if it should be offered to another QMI service
Initialize QMI service.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | serviceType | QMI service e.g. NAS, etc. |
| [in] | clientId | Value previously obtained by invoking CtlService_GetClientId |
| [in] | pTransport | Pointer to underlying transport layer which is responsible for sending and receiving QMUX packets |
| [in] | pIndicationCallback | User function to be be called when QMI indications are received. |
| [in] | pIndicationCallbackContext | A user context for callback. |
| int QmiService_SendRequest |
( |
QmiService * |
pThis, |
|
|
uint16_t |
transactionId, |
|
|
uint8_t * |
qmiRequest, |
|
|
uint16_t |
qmiRequestSize, |
|
|
QMI_RESPONSE_CALLBACK |
pResponseCallback, |
|
|
void * |
pResponseCallbackContext |
|
) |
| |
Send a QMI request to the device and return immediately.
- Parameters
-
| [in] | pThis | The primary object of this call. |
| [in] | transactionId | transaction ID obtained by previous call to QmiService_GetNextTransactionId. |
| [in] | qmiRequest | QMI request (this becomes the QMUX SDU). |
| [in] | qmiRequestSize | Size in bytes of QMI request. |
| [in] | pResponseCallback | Callback called when QMI request completes. |
| [in] | pResponseCallbackContext | Context for callback. |
- Returns
- 0 on success, < 0 on failure.
Shut down QMI service. Brings service to an uninitiaized state.
- Parameters
-
| [in] | pThis | The primary object of this call. |